home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shs_lnladder.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  88 lines

  1. # Jones 3D Cog Script
  2. #
  3. # SHS_LNladder.cog      Make the Lil Nave ladder open/close.  
  4. #
  5. # [JWC, SXC]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10.  
  11. symbols
  12.  
  13. message activated
  14. message    startup
  15.  
  16. sound    laddermove=shs_ladder_creak_c.wav        local
  17. sound    ladderstop=shs_ladderroll_stop.wav        local
  18.  
  19. thing    ladder              
  20. thing   button       
  21. thing    player            local
  22.  
  23. int      filter=0         local        # prevent multiple activates    
  24. int        position=0        local        # ladder position
  25.  
  26.         
  27.  
  28. end
  29.  
  30. # ========================================================================================
  31.  
  32. code
  33.  
  34.  
  35. startup:
  36.    
  37.         
  38.     player= GetLocalPlayerThing();
  39.     return;
  40.  
  41. activated:
  42.    
  43.     If ((GetSenderRef() == button) && (filter == 0))
  44.         {
  45.             #Print("activated");
  46.             filter=1;
  47.             StartCutscene(0);
  48.             SetActorFlags(player, 0x200000);
  49.             StopThing(player);
  50.             DeselectWeaponWait(player);
  51.             PlayMode(player, 60, 0);
  52.             
  53.             # ladder position
  54.             position = 1 - position;
  55.                    
  56.             MoveToFrame(button, 1, 1);
  57.             WaitForStop(button);
  58.                        
  59.             
  60.             # open and close ladder
  61.             If    (position == 1)
  62.             {
  63.                 rotate(ladder, 90, 2, 1.5);
  64.                 PlaySoundLocal(laddermove, 1.0, 0, 0x0000, 0);
  65.                 WaitForStop(ladder);
  66.                 PlaySoundLocal(ladderstop, 1.0, 0, 0x0000, 0);
  67.             }
  68.             else
  69.             {
  70.                 rotate(ladder, -90, 2, 1.5);
  71.                 PlaySoundLocal(laddermove, 1.0, 0, 0x0000, 0);
  72.                 WaitForStop(ladder);
  73.                 PlaySoundLocal(ladderstop, 1.0, 0, 0x0000, 0);
  74.             }
  75.                
  76.             MoveToFrame(button, 0, 1);
  77.             WaitForStop(button);
  78.             
  79.             ClearActorFlags(player, 0x200000);
  80.             EndCutscene();
  81.             filter=0;
  82.         }
  83.     return;
  84.     
  85. end
  86.  
  87.  
  88.